package com.cq.hd.member.controller;

import com.cq.hd.common.response.Result;
import com.cq.hd.common.response.ResultGenerator;
import com.cq.hd.member.api.PopRecordApi;
import com.cq.hd.member.api.dto.PopRecordDto;
import com.cq.hd.member.api.dto.PopRecordSaveDto;
import com.cq.hd.member.api.vo.PopRecordVo;
import com.cq.hd.member.service.TbPopRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 弹窗记录表 前端控制器
 * </p>
 *
 * @author mYunYu
 * @since 2024-01-03
 */
@RestController
public class TbPopRecordController implements PopRecordApi {

    @Autowired
    private TbPopRecordService popRecordService;

    @Override
    public Result<Boolean> savePopRecord(PopRecordSaveDto popRecordSaveDto) {
        return ResultGenerator.success(popRecordService.savePopRecord(popRecordSaveDto));
    }

    @Override
    public Result<List<PopRecordVo>> listByDto(PopRecordDto popRecordDto) {
        return ResultGenerator.success(popRecordService.listByDto(popRecordDto));
    }
}
